package com.wangqi.service;

import com.wangqi.domain.User;
import com.wangqi.repository.UserRepository;
import com.wangqi.repository.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created by wangqi on 2017/4/10.
 */
@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    @Autowired
    private UserDao userDao;

    public void save(User user) {
        userRepository.save(user);
    }

    public User findOneById(long id) {
        return userRepository.findOne(id);
    }

    public User getById(long id) {
        return userDao.getById(id);
    }
}
